import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

//自定义组件
class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    // MaterialApp是根组件
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('First Web'),
        ),
        body: HomeContent(),
      ),
      theme: ThemeData(primaryColor: Colors.blue),
    );
  }
}

//body内容组件
class HomeContent extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new Center(
      //相当于html<div>
      child: Container(
        //文本组件
        child: Text(
          "我在container里我在container里我在container里我在container里我在container里我在container里",
          textAlign: TextAlign.center,
          //溢出后处理方式
          overflow: TextOverflow.fade,
          style: TextStyle(
              fontSize: 26.0,
              color: Colors.red,
              fontWeight: FontWeight.w300,
              decoration: TextDecoration.lineThrough,
              letterSpacing: 2.0),
        ),
        height: 300.0,
        width: 300.0,
        decoration: BoxDecoration(
            color: Colors.yellow,
            border: Border.all(color: Colors.blue, width: 2.0),
            borderRadius: BorderRadius.all(Radius.circular(8))),
        padding: EdgeInsets.all(20),
        transform: Matrix4.translationValues(1.0, 2.0, 3.0),
        alignment: Alignment.bottomLeft,
      ),
    );
  }
}
